#!/usr/bin/env node


const fs = require('fs'),
  lnk = process.argv[2];

if(typeof(lnk) === 'undefined' || process.argv.length !== 3){
  console.error('命令行参数不正确');
  process.exit(1);
}
try{

  const src = fs.readlinkSync(lnk);

  console.log(`${lnk} => ${src}`);

}catch(e){
  console.error(e.message);
  process.exit(2);
}
